#!/bin/sh
#参数1：环境， vagrant、fz01、demo2

echo "--->Getting latest phantomonline files from dowload server to vagrant box..."
sudo yum install openssl libicu-devel expect ncurses-devel -y
sudo cp -rf ../puppet/modules/smx_phantomonline/files/* ./
sudo ./download_phantomonline.sh develop
sudo ./expect_phantomonline.sh

envTag=$1
if [ ! -n "$envTag" ] ;then
	envTag=vagrant
fi
sudo sed -i "1 i cpdfapi.endpoint=https://www-${envTag}.connectedpdf.com" /usr/local/foxitsoftware/webpdf/config/webpdf.conf
sudo service webpdf stop
sudo service webpdf start

echo "--->install cwebtools... "
sudo sh deploy_cwebtools.sh "${envTag}"

